{include file='public/header' /}
<style type="text/css">
	html,body{
		height: 100%;
		width:100%;
		overflow-y: hidden;
	}
	::-webkit-input-placeholder { /* WebKit browsers */
	    color:    #fff;
	}
	:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
	    color:    #fff;
	}
	::-moz-placeholder { /* Mozilla Firefox 19+ */
	    color:    #fff;
	}
	:-ms-input-placeholder { /* Internet Explorer 10+ */
	    color:    #fff;
	}
</style>
<body class="body">
	<div class="content">
		<!-- <div class="header"><a href="{:url('reg')}">注册</a></div> -->
		<!-- <div><img src="__STATIC__/mobile/images/wenzi.png" style="width:100%;"></div> -->
		<div class="submitBox" style="margin-top:80%;">
			<div class="inputbox">
				<label><img src="__STATIC__/mobile/images/ico-m.png"></label>
				<input type="text" id="username" placeholder="请输入手机号"/>
			</div>
			<div class="inputbox">
				<label><img src="__STATIC__/mobile/images/Password.png"></label>
				<input type="password" id="password" placeholder="请输入密码"/>
			</div>
		</div>
		<div class="logibtn"><span>登录</span></div>
		<div class="footerforgot"><a href="{:url('reg')}">立即注册</a></div>
		<div class="footerforgot"><a href="forgotpassword.html">忘记密码？</a></div>
	</div>
	
	<script type="text/javascript">
		//登录
		$(function(){
			$('.logibtn').click(function(){
				var username = $('#username').val();
				var password = $('#password').val();
				if (username == '' || password == '') {
					layer.open({
					    content: '请填写账号密码'
					    ,skin: 'msg'
					    ,time: 2 //2秒后自动关闭
					  });
					return false;
				}
				$.ajax({
	                url:"{:url('login')}",
	                type:'post',
	                cache:false,
	                dataType:'JSON',
	                timeout: 10000,
	                data:{
	                	username:username,
	                	password:password
	                },
	                success:function(data){
	                	if (data.code == 1) {
	                		layer.open({
							    content: data.msg
							    ,skin: 'msg'
							    ,time: 2 //2秒后自动关闭
							  });
	                		window.location.href = data.url;
	                	}else{
	                		layer.open({
							    content: data.msg
							    ,skin: 'msg'
							    ,time: 2 //2秒后自动关闭
							  });
	                	}
	                    
	                    
	                }
	            })
			});
		})
		// fastclick.js组件的引用
		$(function() {
			FastClick.attach(document.body);
		})
	</script>
</body>
</html>